package cn.csust.net2.manager.shared.service;

import java.util.List;

import cn.csust.net2.manager.shared.exception.BeyondAuthorityException;
import cn.csust.net2.manager.shared.po.PO;
import cn.csust.net2.manager.shared.util.ServiceConstant;

import com.extjs.gxt.ui.client.data.FilterPagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
 * 基本表的操作可以使用这一个远程接口实现
 * @author 韩忠金
 *
 * @param <T>
 */
@RemoteServiceRelativePath(ServiceConstant.MANAGER+ServiceConstant.SERVICE_NAME_BEAN)
public interface BeanService<T extends PO> extends RemoteService{
	public void save(String cla,T t)throws BeyondAuthorityException;
	public void save(String cla,List<T> list)throws BeyondAuthorityException;
	public void delete(String cla,List<T> list)throws BeyondAuthorityException;
	public void delete(String cla,T t)throws BeyondAuthorityException;
	public void update(String cla,T t)throws BeyondAuthorityException;
	public void update(String cla, List<T> list)throws BeyondAuthorityException;
	public PagingLoadResult<T> findAllByPaging(String cla,PagingLoadConfig config)throws BeyondAuthorityException;
	public PagingLoadResult<T> findAllByPaging(String cla,FilterPagingLoadConfig config)throws BeyondAuthorityException;
	public List<T> findAll(String cla)throws BeyondAuthorityException;
	public List<T> findByExample(String cla,T t)throws BeyondAuthorityException;
	public PagingLoadResult<T> findByPaging(String cla,T t,PagingLoadConfig config)throws BeyondAuthorityException;
	public long counts(String cla,T t)throws BeyondAuthorityException;
	public T findByUniqueExample(String cla, T t)throws BeyondAuthorityException;
}